// pages/kitchen/kitchen.js
const { get_from, post_to} = require("../../module/service.js")
Page({

  /**
   * 页面的初始数据
   */
  data: {
    shop_id: 0,
    img_list: []
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
    let shop_id = parseInt(options.shop_id)

    if (shop_id === 0) {
      wx.showToast({
        title: '加载失败',
      })
      return;
    }

    get_from('shop/getKitchenImgs', {shop_id: shop_id}).then((res)=>{
      console.log(res.data)
        this.setData({
          shop_id: shop_id,
          img_list: res.data
        });
    });
  },
})